<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>RKNPU DDK: Exection Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">RKNPU DDK
   &#160;<span id="projectnumber">1.3.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="classes.html"><span>Data&#160;Structure&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacerk.html">rk</a></li><li class="navelem"><a class="el" href="namespacerk_1_1nn.html">nn</a></li><li class="navelem"><a class="el" href="classrk_1_1nn_1_1_exection.html">Exection</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Exection Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="exection_8h_source.html">exection.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2897ae9b24aafe80304b4507f16fa097"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrk_1_1nn_1_1_exection.html#a2897ae9b24aafe80304b4507f16fa097">Exection</a> (<a class="el" href="classrk_1_1nn_1_1_graph.html">Graph</a> *graph)</td></tr>
<tr class="separator:a2897ae9b24aafe80304b4507f16fa097"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bce579529d692f22f5a9723fb1be8fd"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrk_1_1nn_1_1_exection.html#a9bce579529d692f22f5a9723fb1be8fd">~Exection</a> ()</td></tr>
<tr class="separator:a9bce579529d692f22f5a9723fb1be8fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a865069bb86c88e114867adcf6c162f9a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classrk_1_1nn_1_1_graph.html">Graph</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrk_1_1nn_1_1_exection.html#a865069bb86c88e114867adcf6c162f9a">GetGraph</a> ()</td></tr>
<tr class="separator:a865069bb86c88e114867adcf6c162f9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ea6d16d5c2b9f6f6146c4395f5e6316"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrk_1_1nn_1_1_exection.html#a3ea6d16d5c2b9f6f6146c4395f5e6316">Build</a> ()</td></tr>
<tr class="separator:a3ea6d16d5c2b9f6f6146c4395f5e6316"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4c8567b9b2998084b2eff198be188fdc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrk_1_1nn_1_1_exection.html#a4c8567b9b2998084b2eff198be188fdc">SetInputs</a> (std::vector&lt; <a class="el" href="structrk_1_1nn_1_1_input_info.html">InputInfo</a> &gt; inputs)</td></tr>
<tr class="separator:a4c8567b9b2998084b2eff198be188fdc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac704aea738c1edc384a97e51d60662b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrk_1_1nn_1_1_exection.html#aac704aea738c1edc384a97e51d60662b">Run</a> ()</td></tr>
<tr class="separator:aac704aea738c1edc384a97e51d60662b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a259e1cad06eb8aeb5fba41c0134c271e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrk_1_1nn_1_1_exection.html#a259e1cad06eb8aeb5fba41c0134c271e">GetOutputs</a> (std::vector&lt; <a class="el" href="structrk_1_1nn_1_1_output_info.html">OutputInfo</a> &gt; outputs)</td></tr>
<tr class="separator:a259e1cad06eb8aeb5fba41c0134c271e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Create a exection on device You need a graph before you create a exection. The overall process is as follows: </p><pre>
 graph = new Graph();
 ...
 exector = new Exection(graph);
 exector-&gt;<a class="el" href="classrk_1_1nn_1_1_exection.html#a3ea6d16d5c2b9f6f6146c4395f5e6316">Build()</a>;</pre><pre> If no errors are encountered, the corresponding model will be created on the NPU.
 In this way, you can start inference on the NPU.</pre><pre> while(something) { 
   exector-&gt;SetInputs(inputs);
   exector-&gt;<a class="el" href="classrk_1_1nn_1_1_exection.html#aac704aea738c1edc384a97e51d60662b">Run()</a>;
   exector-&gt;GetOutputs(outputs);
 }
</pre> 
<p>Definition at line <a class="el" href="exection_8h_source.html#l00090">90</a> of file <a class="el" href="exection_8h_source.html">exection.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a2897ae9b24aafe80304b4507f16fa097"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classrk_1_1nn_1_1_exection.html">Exection</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classrk_1_1nn_1_1_graph.html">Graph</a> *&#160;</td>
          <td class="paramname"><em>graph</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a9bce579529d692f22f5a9723fb1be8fd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">~<a class="el" href="classrk_1_1nn_1_1_exection.html">Exection</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a3ea6d16d5c2b9f6f6146c4395f5e6316"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Build </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create graph on NPU device.</p>
<dl class="section return"><dt>Returns</dt><dd>RK_SUCCESS when success </dd></dl>

</div>
</div>
<a class="anchor" id="a865069bb86c88e114867adcf6c162f9a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classrk_1_1nn_1_1_graph.html">Graph</a>* GetGraph </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Get the graph used by <a class="el" href="classrk_1_1nn_1_1_exection.html">Exection</a></p>
<dl class="section return"><dt>Returns</dt><dd>the graph </dd></dl>

<p>Definition at line <a class="el" href="exection_8h_source.html#l00105">105</a> of file <a class="el" href="exection_8h_source.html">exection.h</a>.</p>

</div>
</div>
<a class="anchor" id="a259e1cad06eb8aeb5fba41c0134c271e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int GetOutputs </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="structrk_1_1nn_1_1_output_info.html">OutputInfo</a> &gt;&#160;</td>
          <td class="paramname"><em>outputs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get model outputs. This function should be called after the <a class="el" href="classrk_1_1nn_1_1_exection.html#aac704aea738c1edc384a97e51d60662b">Run()</a> function. If using a quantitative model, the output is quantized data when OutputInfo-&gt;want_float is false.</p>
<dl class="section return"><dt>Returns</dt><dd>RK_SUCCESS when success </dd></dl>

</div>
</div>
<a class="anchor" id="aac704aea738c1edc384a97e51d60662b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Run </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Do inference on NPU. This function should be called after the <a class="el" href="classrk_1_1nn_1_1_exection.html#a4c8567b9b2998084b2eff198be188fdc">SetInputs()</a> function.</p>
<dl class="section return"><dt>Returns</dt><dd>RK_SUCCESS when success </dd></dl>

</div>
</div>
<a class="anchor" id="a4c8567b9b2998084b2eff198be188fdc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int SetInputs </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="structrk_1_1nn_1_1_input_info.html">InputInfo</a> &gt;&#160;</td>
          <td class="paramname"><em>inputs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set model inputs. When using a quantitative model, the input data must also be the quantized data. When calling <a class="el" href="classrk_1_1nn_1_1_exection.html#a4c8567b9b2998084b2eff198be188fdc">SetInputs()</a> multiple times in succession, only the last data takes effect.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">inputs</td><td>[in] input data </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RK_SUCCESS when success </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="exection_8h_source.html">exection.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
